/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.edu.unmsm.cinfo.siga.datos;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author alumno
 */
@Entity
@Table(name = "INSCRIPCION")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Inscripcion.findAll", query = "SELECT i FROM Inscripcion i"),
    @NamedQuery(name = "Inscripcion.findByAluCod", query = "SELECT i FROM Inscripcion i WHERE i.inscripcionPK.aluCod = :aluCod"),
    @NamedQuery(name = "Inscripcion.findByModgCod", query = "SELECT i FROM Inscripcion i WHERE i.inscripcionPK.modgCod = :modgCod"),
    @NamedQuery(name = "Inscripcion.findByInsFech", query = "SELECT i FROM Inscripcion i WHERE i.insFech = :insFech"),
    @NamedQuery(name = "Inscripcion.findByInsDocr", query = "SELECT i FROM Inscripcion i WHERE i.insDocr = :insDocr"),
    @NamedQuery(name = "Inscripcion.findByInsCert", query = "SELECT i FROM Inscripcion i WHERE i.insCert = :insCert"),
    @NamedQuery(name = "Inscripcion.findByInsNota", query = "SELECT i FROM Inscripcion i WHERE i.insNota = :insNota"),
    @NamedQuery(name = "Inscripcion.findByInsEst", query = "SELECT i FROM Inscripcion i WHERE i.insEst = :insEst"),
    @NamedQuery(name = "Inscripcion.findByInsCond", query = "SELECT i FROM Inscripcion i WHERE i.insCond = :insCond"),
    @NamedQuery(name = "Inscripcion.findByAlutCod", query = "SELECT i FROM Inscripcion i WHERE i.alutCod = :alutCod"),
    @NamedQuery(name = "Inscripcion.findByPreMont", query = "SELECT i FROM Inscripcion i WHERE i.preMont = :preMont"),
    @NamedQuery(name = "Inscripcion.findByInsExacert", query = "SELECT i FROM Inscripcion i WHERE i.insExacert = :insExacert"),
    @NamedQuery(name = "Inscripcion.findByInsHoracert", query = "SELECT i FROM Inscripcion i WHERE i.insHoracert = :insHoracert"),
    @NamedQuery(name = "Inscripcion.findByInsManual", query = "SELECT i FROM Inscripcion i WHERE i.insManual = :insManual"),
    @NamedQuery(name = "Inscripcion.findByInsPractica", query = "SELECT i FROM Inscripcion i WHERE i.insPractica = :insPractica"),
    @NamedQuery(name = "Inscripcion.findByInsCertNota", query = "SELECT i FROM Inscripcion i WHERE i.insCertNota = :insCertNota"),
    @NamedQuery(name = "Inscripcion.findByInsAsistencia", query = "SELECT i FROM Inscripcion i WHERE i.insAsistencia = :insAsistencia"),
    @NamedQuery(name = "Inscripcion.findByInsNotaRect", query = "SELECT i FROM Inscripcion i WHERE i.insNotaRect = :insNotaRect"),
    @NamedQuery(name = "Inscripcion.findByInsXweb", query = "SELECT i FROM Inscripcion i WHERE i.insXweb = :insXweb")})
public class Inscripcion implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected InscripcionPK inscripcionPK;
    @Column(name = "INS_FECH")
    @Temporal(TemporalType.DATE)
    private Date insFech;
    @Column(name = "INS_DOCR")
    private String insDocr;
    @Column(name = "INS_CERT")
    @Temporal(TemporalType.DATE)
    private Date insCert;
    @Column(name = "INS_NOTA")
    private Integer insNota;
    @Basic(optional = false)
    @Column(name = "INS_EST")
    private short insEst;
    @Column(name = "INS_COND")
    private Short insCond;
    @Column(name = "ALUT_COD")
    private Integer alutCod;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "PRE_MONT")
    private Double preMont;
    @Column(name = "INS_EXACERT")
    @Temporal(TemporalType.DATE)
    private Date insExacert;
    @Column(name = "INS_HORACERT")
    @Temporal(TemporalType.TIME)
    private Date insHoracert;
    @Column(name = "INS_MANUAL")
    private Short insManual;
    @Column(name = "INS_PRACTICA")
    private Short insPractica;
    @Column(name = "INS_CERT_NOTA")
    private Integer insCertNota;
    @Column(name = "INS_ASISTENCIA")
    private String insAsistencia;
    @Column(name = "INS_NOTA_RECT")
    private Integer insNotaRect;
    @Column(name = "INS_XWEB")
    private Short insXweb;
    @JoinColumn(name = "PROG_COD", referencedColumnName = "PROG_COD")
    @ManyToOne(fetch = FetchType.LAZY)
    private ProgramaGrupo progCod;
    @JoinColumn(name = "MODG_COD", referencedColumnName = "MODG_COD", insertable = false, updatable = false)
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private ModuloGrupo moduloGrupo;
    @JoinColumn(name = "INST_TIPO", referencedColumnName = "INST_TIPO")
    @ManyToOne(fetch = FetchType.LAZY)
    private InscripcionTipo instTipo;
    @JoinColumn(name = "ALU_COD", referencedColumnName = "ALU_COD", insertable = false, updatable = false)
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Alumno alumno;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "inscripcion", fetch = FetchType.LAZY)
    private List<NotaEliminada> notaEliminadaList;

    public Inscripcion() {
    }

    public Inscripcion(InscripcionPK inscripcionPK) {
        this.inscripcionPK = inscripcionPK;
    }

    public Inscripcion(InscripcionPK inscripcionPK, short insEst) {
        this.inscripcionPK = inscripcionPK;
        this.insEst = insEst;
    }

    public Inscripcion(int aluCod, String modgCod) {
        this.inscripcionPK = new InscripcionPK(aluCod, modgCod);
    }

    public InscripcionPK getInscripcionPK() {
        return inscripcionPK;
    }

    public void setInscripcionPK(InscripcionPK inscripcionPK) {
        this.inscripcionPK = inscripcionPK;
    }

    public Date getInsFech() {
        return insFech;
    }

    public void setInsFech(Date insFech) {
        this.insFech = insFech;
    }

    public String getInsDocr() {
        return insDocr;
    }

    public void setInsDocr(String insDocr) {
        this.insDocr = insDocr;
    }

    public Date getInsCert() {
        return insCert;
    }

    public void setInsCert(Date insCert) {
        this.insCert = insCert;
    }

    public Integer getInsNota() {
        return insNota;
    }

    public void setInsNota(Integer insNota) {
        this.insNota = insNota;
    }

    public short getInsEst() {
        return insEst;
    }

    public void setInsEst(short insEst) {
        this.insEst = insEst;
    }

    public Short getInsCond() {
        return insCond;
    }

    public void setInsCond(Short insCond) {
        this.insCond = insCond;
    }

    public Integer getAlutCod() {
        return alutCod;
    }

    public void setAlutCod(Integer alutCod) {
        this.alutCod = alutCod;
    }

    public Double getPreMont() {
        return preMont;
    }

    public void setPreMont(Double preMont) {
        this.preMont = preMont;
    }

    public Date getInsExacert() {
        return insExacert;
    }

    public void setInsExacert(Date insExacert) {
        this.insExacert = insExacert;
    }

    public Date getInsHoracert() {
        return insHoracert;
    }

    public void setInsHoracert(Date insHoracert) {
        this.insHoracert = insHoracert;
    }

    public Short getInsManual() {
        return insManual;
    }

    public void setInsManual(Short insManual) {
        this.insManual = insManual;
    }

    public Short getInsPractica() {
        return insPractica;
    }

    public void setInsPractica(Short insPractica) {
        this.insPractica = insPractica;
    }

    public Integer getInsCertNota() {
        return insCertNota;
    }

    public void setInsCertNota(Integer insCertNota) {
        this.insCertNota = insCertNota;
    }

    public String getInsAsistencia() {
        return insAsistencia;
    }

    public void setInsAsistencia(String insAsistencia) {
        this.insAsistencia = insAsistencia;
    }

    public Integer getInsNotaRect() {
        return insNotaRect;
    }

    public void setInsNotaRect(Integer insNotaRect) {
        this.insNotaRect = insNotaRect;
    }

    public Short getInsXweb() {
        return insXweb;
    }

    public void setInsXweb(Short insXweb) {
        this.insXweb = insXweb;
    }

    public ProgramaGrupo getProgCod() {
        return progCod;
    }

    public void setProgCod(ProgramaGrupo progCod) {
        this.progCod = progCod;
    }

    public ModuloGrupo getModuloGrupo() {
        return moduloGrupo;
    }

    public void setModuloGrupo(ModuloGrupo moduloGrupo) {
        this.moduloGrupo = moduloGrupo;
    }

    public InscripcionTipo getInstTipo() {
        return instTipo;
    }

    public void setInstTipo(InscripcionTipo instTipo) {
        this.instTipo = instTipo;
    }

    public Alumno getAlumno() {
        return alumno;
    }

    public void setAlumno(Alumno alumno) {
        this.alumno = alumno;
    }

    @XmlTransient
    public List<NotaEliminada> getNotaEliminadaList() {
        return notaEliminadaList;
    }

    public void setNotaEliminadaList(List<NotaEliminada> notaEliminadaList) {
        this.notaEliminadaList = notaEliminadaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (inscripcionPK != null ? inscripcionPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Inscripcion)) {
            return false;
        }
        Inscripcion other = (Inscripcion) object;
        if ((this.inscripcionPK == null && other.inscripcionPK != null) || (this.inscripcionPK != null && !this.inscripcionPK.equals(other.inscripcionPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.edu.unmsm.cinfo.siga.datos.Inscripcion[ inscripcionPK=" + inscripcionPK + " ]";
    }
    
}
